bug#78901: [PATCH] js-ts-mode: Fix auto-mode-alist regexp
authorLiam Hupfer <liam@hpfr.net>
Thu, 26 Jun 2025 03:47:34 +0000 (22:47 -0500)
committerEli Zaretskii <eliz@gnu.org>
Sat, 28 Jun 2025 10:11:01 +0000 (13:11 +0300)
Align the js-ts-mode entry with the javascript-mode entries in the
default auto-mode-alist value in lisp/files.el. Otherwise, js-ts-mode is
not associated with .js files.

* lisp/progmodes/js.el (js-ts-mode): Fix auto-mode-alist regexp.

Fixes: 2023-01-20 6b2f85caa6ca "Make tree-sitter based modes optional"
lisp/progmodes/js.el

index 3e789218fdef19fc2647d685433bb65e5e3421c9..edb77db9bfefa8fd724137439b39e2b13c0c8954 100644 (file)
@@ -3961,7 +3961,7 @@ See `treesit-thing-settings' for more information.")
     (treesit-major-mode-setup)
 
     (add-to-list 'auto-mode-alist
-                 '("\\(\\.js[mx]\\|\\.har\\)\\'" . js-ts-mode))))
+                 '("\\(\\.js[mx]?\\|\\.har\\)\\'" . js-ts-mode))))
 
 (derived-mode-add-parents 'js-ts-mode '(js-mode))